# ADB Terminal **ADB** is the abbreviation for **Android Debug Bridge**, a set of command-line tools used for communication between a host computer and a device. Through **ADB**, users can view device connection status, enter the device Shell, transfer files, restart the device, and execute debugging commands on the computer side. On the **Quectel Pi M1 / L1 Debian** system, ADB is primarily used for local debugging and quick file transfers during the development phase. After connecting the computer to the development board via a **USB Type-C** cable, you can use commands such as `adb devices`, `adb shell`, `adb push`, `adb pull` to manage the device. > 💡 Note: The `adb shell` on L1 defaults to the `root` user, which can be used directly to view system status, start services, and modify configurations. When executing high-privilege commands, you typically do not need to add `sudo`. # Preparation 1. Prepare a **USB** to **Type-C** cable, connect the **Type-C** end to the **USB-C** port of the **Quectel Pi M1 / L1**, and connect the other end to the host computer. ```{image} images/image_VeKnbClWnonahMx3Yr1chnqpn4c.webp :width: 794px :height: 523px ``` 1. On the computer side, download the [platform-tools]() tool and extract it to a local directory. 2. Open the folder where the **platform-tools** tool is located, type **cmd** in the address bar at the top, and press Enter to open the **ADB** terminal. ```{image} images/image_Mk8ibkEdloqWZwxopC4c58fenmh.webp :width: 1017px :height: 712px ``` ```{image} images/image_CMNubVhpyobOsYxowUWcPZ8Cn4c.webp :width: 1017px :height: 713px ``` ```{image} images/image_Tc48bDJmDoz7EZx6mFWcf8NKn8f.webp :width: 1113px :height: 626px ``` # Software Installation The host computer needs to have **platform-tools** installed or extracted, which includes the `adb` command. The Quectel Pi L1 / M1 Debian system already has the ADB service integrated, with the service name `adbd.service` and the program path `/sbin/adbd`. Typically, no additional software packages need to be installed. You can check the ADB service status on the development board: ```bash systemctl status adbd.service --no-pager -l ``` # Software Configuration The ADB service is managed by `adbd.service`. Common configuration and management methods are as follows: | **Configuration Item** | **Description** | | --- | --- | | Service Name | `adbd.service` | | Dependent Service | `usb.service` | | Connection Method | USB Type-C cable connecting the host computer and the development board | | Typical Use Cases | Shell debugging, file transfer, device status viewing | To restrict ADB usage, you can stop or disable the ADB service. It is recommended to restart the system after disabling to keep the state consistent: ```bash sudo systemctl stop adbd.service sudo systemctl disable adbd.service sudo reboot ``` To re-enable the ADB service, execute: ```bash sudo systemctl start adbd.service sudo systemctl enable adbd.service sudo reboot ``` # Software Startup Start the ADB service: ```bash sudo systemctl start adbd.service ``` Enable auto-start on boot: ```bash sudo systemctl enable adbd.service ``` Check current status: ```bash systemctl status adbd.service --no-pager -l systemctl is-active adbd.service ``` Restart the service: ```bash sudo systemctl restart adbd.service ``` # ADB Debugging ## View Connected Devices Execute in the **ADB** terminal on the host computer: ```bash adb devices ``` If a device serial number appears in the list with the status `device`, it means the computer has recognized the development board. ## Enter Device Shell Execute on the host computer: ```bash adb shell ``` After entering the Shell, you can execute common Linux commands in the development board system. The L1 ADB Shell defaults to the `root` user. You can confirm this by executing: ```bash id whoami ``` To exit the Shell, enter: ```bash exit ``` ```{image} images/image_MozfbNJYDoclcXxs27scINhanhc.webp :width: 1113px :height: 626px ``` ## Transfer Files from Computer to Device ```bash # Usage: adb push adb push ./test.txt /data/local/tmp/ ``` ## Transfer Files from Device to Computer ```bash # Usage: adb pull adb pull /data/local/tmp/test.txt ./ ``` Where `./` indicates saving to the directory where the **ADB** terminal is currently open. ## Restart the Device ```bash adb reboot ``` # Troubleshooting | **Symptom** | **Troubleshooting Method** | | --- | --- | | `adb devices` shows no device | Check if the USB cable supports data transfer; confirm the cable is connected to the USB-C port of the L1 / M1; re-plug and execute `adb devices` again. | | Device status is `offline` | Execute `adb kill-server` and `adb start-server`, then reconnect. | | No `adb` command on host computer | Confirm that platform-tools has been extracted, open the terminal in that directory, or add platform-tools to the system environment variables. | | Service not running on the development board | Execute `systemctl status adbd.service --no-pager -l` on the development board to check the service status, and execute `sudo systemctl restart adbd.service` as needed. | | File transfer failed | Check if the target path exists and has write permissions. It is recommended to use the `/data/local/tmp/` directory for testing first. |